﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Register Src="~/Views/Shared/HomeSearch.ascx" TagName="homesearch" TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Trang chủ 
</asp:Content>


<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
<link href="Content/slider.css" rel="stylesheet" type="text/css" />
<script src="Scripts/slider.js"></script>
<script>
    $(document).ready(function (e) {
        $("body").css("min-width", "1100px");
        $(".headermenu_item a").eq(0).addClass("active");
    });
</script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="homecontent">

<div id="homeintroduction">
	<div id="homecategorylist" class="verticallist">
<% 
    int lang = 2;
    List<VietImage.Models.Category> ParentCategories = (List<VietImage.Models.Category>)ViewData["ParentCategories"];
    foreach (VietImage.Models.Category cat in ParentCategories.Take(8))
   {
       if (cat.GetDetail(lang).Name == "")
       {
           String name = "No title";
       %>                <p><%= Html.ActionLink(name, "Index", "Category", new { id = cat.ID }, null)%></p>
<%
}
       else
       {
           %>
           <p><%= Html.ActionLink(cat.GetDetail(lang).Name, "Index", "Category", new { id = cat.ID }, null)%></p>
           <%
       }
   } %>
	</div>
	<div class="verticallist verticallistline">
        <div class="verticallistline_pattern"></div>
	</div>
	<div id="homesubcategorylist" class="verticallist">
<%  List<VietImage.Models.Category> lstSubCat = (List<VietImage.Models.Category>)ViewData["WeeklySubCategories"];
    for (int i = 0; i < lstSubCat.Count; i++)
    {
        if (lstSubCat[i].PrimaryImage != null)
        {
        %>                    
    	<div class="homesubcategoryimge"><a href="/Category/Detail/<%=lstSubCat[i].ID %>"><img  src="/Image/Category/<%=lstSubCat[i].ID%>" alt="<%=lstSubCat[i].GetDetail(lang).Name %>" title="<%=lstSubCat[i].GetDetail(lang).Name %>" /></a></div>
        <%
        }
        else
        {
            %>
    	<div class="homesubcategoryimge"><a href="/Category/Detail/<%=lstSubCat[i].ID %>"><img  src="/Image/Display/0" alt="<%=lstSubCat[i].GetDetail(lang).Name %>" title="<%=lstSubCat[i].GetDetail(lang).Name %>" /></a></div>
            <%
        }
                    
    }
    %>
    </div>
	<div class="verticallist verticallistline">
        <div class="verticallistline_pattern"></div>
	</div>
	<div id="homeslider" class="slider verticallist">
        <div class="slider_button slider_prevpic"></div>
        <div class="slider_button slider_nextpic"></div>

<%
    List<VietImage.Models.Image> DailyImages = (List<VietImage.Models.Image>)ViewData["DailyImages"];
    if (DailyImages != null && DailyImages.Count > 0)
    {
        foreach (VietImage.Models.Image img in DailyImages)
        {
            String imgDetail = " imgname=\"" + img.GetDetail(lang).Name + "\" imgauthor=\"" + img.Author + "\" imgdate=\"" + img.CreatedTime.ToString("dd / MM / yyyy") + "\" imgdescription=\"" + img.GetDetail(lang).Description + "\" ";
                                
%>
    <div class="slider_image"><img <%= imgDetail %> id="Img<%= img.ID %>" src="/Image/Display/<%= img.ID %>" alt="<%=img.GetDetail(lang).Name %>" title="<%=img.GetDetail(lang).Name %>" /></div>
<%
        }
    }
    else
    {
                        
%>
    <div class="slider_image"><img src="/Content/Images/noimage_big.png" alt="No image" title="No image" /></div>
<%
    }
%>
        <div class="slider_tooltip">
            <div class="slider_picname"></div>
            <div class="slider_picauthor"></div>
            <div class="slider_picdate"></div>
            <div class="slider_picdesc"></div>
            
            <div class="slider_tooltip_right"></div>
            <div class="slider_tooltip_bottom"></div>
            <div class="slider_tooltip_bottomright"></div>
        </div>
	</div>
	<div class="clear"></div>

</div>
<div id="homesearchpanel">
    <uc:homesearch ID="Homesearch1" runat="server" />
</div>
<div class="clear"></div>

</div>
<div class="clear"></div>

</asp:Content>



